import { useParams } from 'react-router-dom'
import axios from 'axios'
import { Image } from 'antd'
import { useState, useEffect, useCallback, useRef } from 'react'
//import m from '../assets'
interface List {
  original_img: string,
  goods_name: string
}

function Home() {
  


 
  
  let imglist: List[] = []
  let [video, setvideo] = useState(`http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4`)
  const [list, setList] = useState<List[]>([]);
  const videosrc = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4';

  
  // useEffect(() => {
  //   axios.get('https://xixie.nywuji.com/index.php/api/goods/index', {
  //     params: {
  //       page: 1,
  //       limit: 300
  //     }
  //   }).then(res => {
  //     imglist = res.data.data.data;
  //     setList(imglist);
  //   })
  // }, [])

  interface Refdom {
    current: boolean | undefined
  }
  const mounted: Refdom = useRef();

  useEffect(() => {
    if (!mounted.current) {
      mounted.current = true;
    } else {
      //console.log('I am didUpdate')
    }
  });





  return (
    <>
      home page


      <video src={videosrc} controls />
      {
        list.map((item, index) => {
          return (<Image width={200} key={index} src={item.original_img} />)
        })
      }




    </>
  );
}

export default Home;
